package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.entity.NursingProject;
import com.zzyl.mapper.NursingProjectMapper;
import com.zzyl.service.NurseProjectService;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NurseProjectServiceImpl implements NurseProjectService {

    @Autowired
    private NursingProjectMapper nursingProjectMapper;

    @Override
    public PageResponse selectByPage(String name, Integer pageNum, Integer pageSize, Integer status) {
        //使用pagehelper完成分页查询
        PageHelper.startPage(pageNum,pageSize);
        //调用mapper层方法,实现分页查询
        Page<NursingProjectVo> nursingProjectPage = nursingProjectMapper.selectByPage(name, status);


        return PageResponse.of(nursingProjectPage,NursingProjectVo.class);
    }
}
